import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueSetupExtend from 'vite-plugin-vue-setup-extend'

// 这边用的是node的模块化 需要require
const path = require('path')

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue({
      reactivityTransform: true,
    }),
    vueSetupExtend(),
  ],
  // 配置@别名
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
  },
  // 变量less  混入less  自动注入
  css: {
    preprocessorOptions: {
      less: {
        additionalData: `
          @import "@/assets/styles/variables.less";
          @import "@/assets/styles/mixins.less";
        `,
      },
    },
  },
})
